
#pragma once

#include "wx/wx.h"
#include "GraphManager.h"
#include "CodecManager.h"

// The application entry point class
class HDPVRTool : public wxApp
{
public:
 
    virtual bool OnInit();

};


class MainFrame : public wxFrame
{
public:
    MainFrame(const wxString& title);
	~MainFrame();

    // event handlers
    void OnQuit(wxCommandEvent& event);
    void OnAbout(wxCommandEvent& event);
	void OnSize(wxSizeEvent& event);
	void OnPaint(wxPaintEvent& event);
	void OnErase(wxEraseEvent& event);
	void OnMove(wxMoveEvent& event);
	void ShowContextMenu (wxContextMenuEvent& event);

	void OnOpen(wxCommandEvent& event);
	void OnClose(wxCommandEvent& event);
	void OnStartPlayback(wxCommandEvent& event);
	void OnStopPlayback(wxCommandEvent& event);
	void OnMuteToggle(wxCommandEvent& event);
	void OnFullScreenToggle(wxCommandEvent& event);

	// helper function
	RECT GetClientWindowArea();
private:

	void PaintBackground(wxDC& dc);

	wxMenu* contextMenu;

	HWND vidWnd;
	CodecManager* cMan;
	GraphManager* graphMan;
	BOOL isMuted;

    DECLARE_EVENT_TABLE()
};

// IDs for the controls and the menu commands
enum
{
    // menu items
    ID_Quit = wxID_EXIT,
    ID_About = wxID_ABOUT,
	ID_OpenGraph = 1,
	ID_CloseGraph,
	ID_StartCapture,
	ID_StopCapture,
	ID_ToggleMute,
	ID_ToggleFullScreen
};

// ----------------------------------------------------------------------------
// event tables and other macros for wxWidgets
// ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(MainFrame, wxFrame)
    EVT_MENU(ID_Quit,  MainFrame::OnQuit)
    EVT_MENU(ID_About, MainFrame::OnAbout)
	EVT_MENU(ID_OpenGraph, MainFrame::OnOpen)
	EVT_MENU(ID_CloseGraph, MainFrame::OnClose)
	EVT_MENU(ID_StartCapture, MainFrame::OnStartPlayback)
	EVT_MENU(ID_StopCapture, MainFrame::OnStopPlayback)
	EVT_MENU(ID_ToggleMute, MainFrame::OnMuteToggle)
	EVT_MENU(ID_ToggleFullScreen, MainFrame::OnFullScreenToggle)
	EVT_CONTEXT_MENU(MainFrame::ShowContextMenu)
	EVT_PAINT(MainFrame::OnPaint)
	EVT_ERASE_BACKGROUND(MainFrame::OnErase)
	EVT_SIZE(MainFrame::OnSize)
	EVT_MOVE(MainFrame::OnMove)
END_EVENT_TABLE()


IMPLEMENT_APP(HDPVRTool)